﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Mytrip.Users.mytrip_Roles>>" %>

<asp:Content ContentPlaceHolderID="TitleContent" runat="server">
    <%=Html.PageTitle(UserLanguage.all_roles,"/") %>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <h2 class="adminlink">
        <%= Html.ActionLink(UserLanguage.all_users, "Index")%></h2>
    <h2>
        <%=UserLanguage.all_roles %></h2>
    <%=Html.MytripPager(10, (int)ViewData["total"],"...")%>
    <table>
        <tr>
            <th class="dableinput">
                <% using (Html.BeginForm("CreateRole", "Admin"))
                   { %>
                <%= Html.TextBox("RoleName") %>
                <%= Html.ValidationMessage("RoleName")%>
                <%=Html.MytripInput("submit",UserLanguage.add_role) %>
                <% } %>
            </th>
            <th class="oneinput">
                <% using (Html.BeginForm())
                   { %>
                <%= Html.TextBox("search")%>
                <%=Html.MytripInput("submit",UserLanguage.search_role) %>
                <%} %>
            </th>
        </tr>
    </table>
    <table>
        <tr>
            <th class="editdelite">
            </th>
            <th>
                <%= Html.ActionLink(UserLanguage.RoleName, "IndexRole", new { id = 1, id2 = 10, id3 = Html.MytripSort("RoleName") })%>
            </th>
            <th>
                <%= Html.ActionLink(UserLanguage.UserCount, "IndexRole", new { id = 1, id2 = 10, id3 = Html.MytripSort("UserCount") })%>
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%=Html.MytripImage("/Content/images/Keys.png", item.RoleName,20,0,0) %>
                <%=Html.MytripImageLink(Url.Action("DeleteRole", new { id = item.RoleName }),
                                                 "/Content/images/delete.png", "delete", 20, 0, 0, UserLanguage.are_you_sure)%>
            </td>
            <td>
                <%= Html.Encode(item.RoleName) %>
            </td>
            <td>
                <%= Html.Encode(item.mytrip_Users.Count()) %>
            </td>
        </tr>
        <% } %>
    </table>
    <%=Html.MytripPager(10, (int)ViewData["total"],"...")%>
</asp:Content>
